package com.wlsk.license.common.enums;

import java.util.HashMap;
import java.util.Map;

/**
 * 包车牌类型
 */
public enum CharterPlateProductTypeEnum implements BaseEnum<CharterPlateProductTypeEnum, Integer> {

    ELECTRONIC_CHARTER_PLATE(1, "电子包车牌"),

    PAPER_CHARTER_PLATE(2, "纸质包车牌");

    private final Integer code;

    private final String description;

    private static Map<Integer, CharterPlateProductTypeEnum> valueMap = new HashMap<>();

    CharterPlateProductTypeEnum(Integer code, String description) {
        this.code = code;
        this.description = description;
    }

    static {
        for (CharterPlateProductTypeEnum e : CharterPlateProductTypeEnum.values()) {
            valueMap.put(e.code, e);
        }
    }

    public static CharterPlateProductTypeEnum get(String value) {
        return valueMap.get(value);
    }

    @Override
    public Integer getCode() {
        return code;
    }

    @Override
    public String getDescription() {
        return description;
    }

    @Override
    public CharterPlateProductTypeEnum getByCode(Integer code) {
        return valueMap.get(code);
    }
}
